<?php $this->load->library('urlutility');?>
<style>
#prev {
	margin-top:-313px;
}
#next {
	margin-top:-313px;
}
</style>
<script type="text/javascript" language="javascript">
	$(function() {
		$('#prev').addClass('hide');
		$('#next').addClass('hide');
		$('#foo0').carouFredSel({
			auto:{pauseOnHover: 'resume'},
			scroll:1,
			prev: '#prev',
			next: '#next',
		});
		$('.list_carousel').mouseover(function(){
			$('#prev').removeClass('hide');
			$('#next').removeClass('hide');						  
		});
		$('.list_carousel').mouseout(function(){
			$('#prev').addClass('hide');
			$('#next').addClass('hide');						  
		});
	});
</script>
<?php if(count($listbanner)>0){?>
<div class="list_carousel ov_fl_hidden h277">
  <ul id="foo0" class="h277">
    <?php foreach($listbanner as $k=>$banner){if($banner);?>
    <li> <a href="<?php echo $this->urlutility->gethotel_information($banner[0]['hotelid'],$data[0]['name'],'?from='.$_GET['from'].'&to='.$_GET['to'].'&room='.$_GET['room']);?>" class="item ov_fl_hidden"> <img width="886" height="370" class="fl bder_t1_8fa8bc" src="<?php echo base_url(); ?>uploads/hotelbanner/<?php echo $banner[0]['avatar'] ?>"/> </a> </li>
    <?php }?>
  </ul>
  <a href="javascript:void(0);" id="prev" class="fl"><img src="<?php echo base_url(); ?>public/images/btn_prev.gif"/></a> <a href="javascript:void(0);" id="next" class="fr"><img src="<?php echo base_url(); ?>public/images/btn_next.gif"/></a> </div>
<?php }?>
<div class="fl w660">
  <h1 class="orange item ff_museo700 mgb0 txt_indent20">Hotel Search Result</h1>
  <div class="item bder_d5 txt_indent20 pdt5 pdb5">
    <div class="fl pdt3">10 of <?php echo count($total); ?> show&nbsp;&nbsp;</div>
    <div class="fl w230">
      <input type="text" placeholder="Name" id="hotel_name" class="bder_d5 w153" value=""/>
      <input type="button" id="btnsearch_hotel_name" class="bder_d5 cursor_poiter btn_submit_search" value=" "/>
    </div>
    <div class="fr"><img width="10" height="15" onclick="LeftClick3('spnumberpage','sptotalpage','boxoutsize');" src="<?php echo base_url(); ?>public/images/arrow_01.jpg" class="fl cursor_poiter mgt4 mgr-15 pst_relative zindex10"><span class="fl gray f18 mgl-5"><span  id="spnumberpage">1</span>&nbsp;/&nbsp;<span id="sptotalpage"><?php echo ceil(count($total)/10); ?></span>&nbsp;</span><img width="10" height="15" onclick="RightClick3('spnumberpage','sptotalpage','boxoutsize','getajax_hotel_search_result',listroomhotel,'<?php echo $_GET['provide'] ?>','<?php echo $_GET['from'] ?>','<?php echo $_GET['to'] ?>','<?php echo intval($_GET['room']); ?>'; ?>');" src="<?php echo base_url(); ?>public/images/arrow_01.jpg" class="fl cursor_poiter mgt4 pst_relative zindex10 tran_180deg"></div>
    <div class="fr pdr44 pdt3">Sort by&nbsp;&nbsp;
      <select name="priority" class="f11 gray bder_d5" id="priority" onchange="searchbyhotel('priority')">
        <option value="bestdeal" <?php if(isset($_GET['priority'])=='bestdeal') echo "selected";?>>Best deal</option>
        <option value="price" <?php if(isset($_GET['priority'])=='price') echo "selected";?>>Price</option>
        <option value="star" <?php if(isset($_GET['priority'])=='star') echo "selected";?>>Star</option>
        <option value="recommentdations" <?php if(isset($_GET['priority'])=='recommentdations') echo "selected";?>>Our recommentdations</option>
      </select>
    </div>
  </div>
  <div class="item" style="overflow:hidden;">
    <div class="item pst_relative zindex10" id="boxoutsize">
      <div class="fl w660" id="box_inside1">
        <?php 
             foreach($data as $list){?>
        <div class="item bder_b1_d5 pdt12 pdb10">
          <h1 class="blue ff_museo700 mgt0 pdl10 lheight23 cap f16"><span class="fl"><?php echo $list["name"]; ?></span>
            <div class="fl pdl10 blue">
              <?php if(count($list["star"])>0){ for($i=1;$i<=$list["star"];$i++){?>
              <img width="12" height="11" class="pdr4" src="<?php echo base_url(); ?>public/images/star_01.png">
              <?php }}if($list["star"]<5){ for($i=$list["star"];$i<5;$i++){?>
              <img width="12" height="11" class="pdr4" src="<?php echo base_url(); ?>public/images/hidden-star-05.png">
              <?php	}	
                            }?>
            </div>
            <br>
            <em class="ff_museo500 gray lighter cap f13"><?php echo $list["provide"]; ?></em></h1>
          <a href="<?php echo $this->urlutility->gethotel_information($list['id'],$list['name'],'?from='.$_GET['from'].'&to='.$_GET['to'].'&room='.$_GET['room']);?>"><img width="97" height="75" src="<?php echo base_url()."uploads/hotel/".$list["avatar"]; ?>" alt="<?php echo "Best of Myanmar - ".$list["name"]; ?>" title="<?php echo "Best of Myanmar - ".$list["name"] ?>" class="fl mgr8 pdl10"/></a>
          <div class="fl w273 pdr20 black descriptionhotel"><strong class="f14">
            <?php if($list['category']==0)echo "Updating...";
		  															  if($list['category']==1)echo "<span class='fl mgt-2'>Hotel - Wifi</span>";
		  															  if($list['category']==2)echo "Hotel";
																	  if($list['category']==3)echo "Hotel - Wifi in Public Area";
																	  if($list['category']==4)echo "Resort";
																	  if($list['category']==5)echo "Guest House";?>
            <?php if($list['category']==1){?>
            <img class="mgt-9 fl" src="<?php echo base_url()?>public/images/BOM_WIFI.gif"/>
            <?php }?>
            </strong><br>
            <span class="justify item"><?php echo $list["description"]; ?>
            <!-- ... <a href="<?php echo $this->urlutility->gethotel_information($list['id'],$list['name'],'?from='.$_GET['from'].'&to='.$_GET['to'].'&room='.$_GET['room']);?>" class="blue">more »</a>-->
            </span></div>
          <div class="fr txt_center ff_museo700 w60 f11"><strong class="f16 linethrought">&nbsp;$<?php echo $list['oldprice'] ?>&nbsp;</strong><br>
            <strong class="f18 orange">$ <?php echo $list["minprice"] ?> </strong><br>
            for 1 night <a class="ff_museo500 bgr_143167 f14 white pdt4 pdb3 mgt4 item" href="<?php echo $this->urlutility->gethotel_information($list['id'],$list['name'],'?from='.$_GET['from'].'&to='.$_GET['to'].'&room='.$_GET['room']);?>">DETAILS</a></div>
        </div>
        <?php }?>
      </div>
    </div>
  </div>
  <div class="item pdt16 pdb16">
    <div class="fr"> <img width="10" height="15" class="fl bder_d5 fl pdt4 pdb4 pdl7 pdr9 mgl5 cursor_poiter" onclick="LeftClick3('spnumberpage','sptotalpage','boxoutsize');" src="<?php echo base_url(); ?>public/images/arrow_01.jpg">
      <?php for($i=1;$i<=ceil(count($total)/10);$i++){?>
      <div id="divpager<?php echo $i ?>" class="bder_d5 fl pdt4 pdb4 txt_center w24 mgl5 black cursor_poiter" onclick="loaddata('<?php echo $i ?>','boxoutsize',postdata3,'spnumberpage','sptotalpage','getajax_hotel_search_result',listroomhotel);"><?php echo $i ?></div>
      <?php
	}?>
      <img width="10" height="15" class="fl bder_d5 fl pdt4 pdb4 pdl9 pdr7 mgl5 cursor_poiter" src="<?php echo base_url(); ?>public/images/arrow_03.png" onclick="RightClick3('spnumberpage','sptotalpage','boxoutsize','getajax_hotel_search_result',listroomhotel,'<?php echo $_GET['provide'] ?>','<?php echo $_GET['from'] ?>','<?php echo $_GET['to'] ?>','<?php echo intval($_GET['room']); ?>');"> </div>
  </div>
</div>
<div class="fr w193 pdt10">
  <div class="item bgr_gray pdt10">
    <div class="fl pdl10 w173">
      <h3 class="blue ff_museo500 item mgt0 mgb0"><span class="fl">Refine your search&nbsp;</span><img width="20" height="20" class="fl" src="<?php echo base_url(); ?>public/images/iconsearch.png"></h3>
      <h3 class="bgr_orange white ff_museo500 f15 item pdt6 pdb5 txt_indent10 mgt13 mgb3 lighter">Star</h3>
      <div class="item">
        <input type="checkbox" name="star" value="1" id="star1" onclick="searchbyhotel('star1');" class="fl mgl10 mgt1">
        <img width="13" height="13" src="<?php echo base_url(); ?>public/images/star_01.png" class="pdr4"><img width="13" height="13" src="/BestofMyanmar/public/images/hidden-star-05.png" class="pdr4"><img width="13" height="13" src="/BestofMyanmar/public/images/hidden-star-05.png" class="pdr4"><img width="13" height="13" src="/BestofMyanmar/public/images/hidden-star-05.png" class="pdr4"><img width="13" height="13" src="/BestofMyanmar/public/images/hidden-star-05.png" class="pdr4"> 1 star</div>
      <div class="item">
        <input type="checkbox" name="star" value="2" id="star2" onclick="searchbyhotel('star2');"  class="fl mgl10 mgt1 star">
        <img width="13" height="13" src="<?php echo base_url(); ?>public/images/star_01.png" class="pdr1">&nbsp;<img width="13" height="13" src="<?php echo base_url(); ?>public/images/star_01.png" class="pdr4"><img width="13" height="13" src="/BestofMyanmar/public/images/hidden-star-05.png" class="pdr4"><img width="13" height="13" src="/BestofMyanmar/public/images/hidden-star-05.png" class="pdr4"><img width="13" height="13" src="/BestofMyanmar/public/images/hidden-star-05.png" class="pdr4"> 2 stars</div>
      <div class="item">
        <input type="checkbox" name="star" value="3" id="star3" onclick="searchbyhotel('star3');"  class="fl mgl10 mgt1">
        <img width="13" height="13" src="<?php echo base_url(); ?>public/images/star_01.png" class="pdr1">&nbsp;<img width="13" height="13" src="<?php echo base_url(); ?>public/images/star_01.png" class="pdr1">&nbsp;<img width="13" height="13" src="<?php echo base_url(); ?>public/images/star_01.png" class="pdr4"><img width="13" height="13" src="/BestofMyanmar/public/images/hidden-star-05.png" class="pdr4"><img width="13" height="13" src="/BestofMyanmar/public/images/hidden-star-05.png" class="pdr4"> 3 stars</div>
      <div class="item">
        <input type="checkbox" name="star" value="4" id="star4" onclick="searchbyhotel('star4');"  class="fl mgl10 mgt1">
        <img width="13" height="13" src="<?php echo base_url(); ?>public/images/star_01.png" class="pdr1">&nbsp;<img width="13" height="13" src="<?php echo base_url(); ?>public/images/star_01.png" class="pdr1">&nbsp;<img width="13" height="13" src="<?php echo base_url(); ?>public/images/star_01.png" class="pdr1">&nbsp;<img width="13" height="13" src="<?php echo base_url(); ?>public/images/star_01.png" class="pdr4"><img width="13" height="13" src="/BestofMyanmar/public/images/hidden-star-05.png" class="pdr4"> 4 stars</div>
      <div class="item">
        <input type="checkbox" name="star" value="5" id="star5" onclick="searchbyhotel('star5');"  class="fl mgl10 mgt1">
        <img width="13" height="13" src="<?php echo base_url(); ?>public/images/star_01.png" class="pdr1">&nbsp;<img width="13" height="13" src="<?php echo base_url(); ?>public/images/star_01.png" class="pdr1">&nbsp;<img width="13" height="13" src="<?php echo base_url(); ?>public/images/star_01.png" class="pdr1">&nbsp;<img width="13" height="13" src="<?php echo base_url(); ?>public/images/star_01.png" class="pdr1">&nbsp;<img width="13" height="13" src="<?php echo base_url(); ?>public/images/star_01.png" class="pdr4"> 5 stars</div>
      <h3 class="bgr_orange white txt_indent10 ff_museo500 f15 item pdt6 pdb5 mgt13 mgb3 lighter">Price (USD)</h3>
      <div class="item">
        <input type="checkbox" name="price" id="price1" value="50" onclick="searchbyhotel('price1');" class="fl mgl10 mgt1">
        Less than $50 </div>
      <div class="item">
        <input type="checkbox" name="price" id="price2" value="50-99" onclick="searchbyhotel('price2');" class="fl mgl10 mgt1">
        From $50 to $99</div>
      <div class="item">
        <input type="checkbox" name="price" id="price3" value="100-149" onclick="searchbyhotel('price3');" class="fl mgl10 mgt1">
        From $100 to $149</div>
      <div class="item">
        <input type="checkbox" name="price" id="price4" value="150-200" onclick="searchbyhotel('price4');" class="fl mgl10 mgt1">
        From $150 to $200</div>
      <div class="item">
        <input type="checkbox" name="price" id="price5" value="200" onclick="searchbyhotel('price5');" class="fl mgl10 mgt1">
        More than $200</div>
      <h3 class="bgr_orange white txt_indent10 ff_museo500 f15 item pdt6 pdb5 mgt8 mgb3 lighter">Facilities / Services</h3>
      <div class="item pdt4">
        <input type="checkbox" name="service" value="Restaurant" class="fl mgl10 mgt1 servicesser1" onclick="searchbyhotel('ser1');">
        Restaurant</div>
      <div class="item">
        <input type="checkbox" name="service" value="Internet" class="fl mgl10 mgt1 servicesser2" onclick="searchbyhotel('ser2');">
        Internet</div>
      <div class="item">
        <input type="checkbox" name="service" value="Swimming pool" class="fl mgl10 mgt1 servicesser3" onclick="searchbyhotel('ser3');">
        Swimming pool</div>
      <div class="item">
        <input type="checkbox" name="service" value="Airport transfer" class="fl mgl10 mgt1 servicesser4" onclick="searchbyhotel('ser4');">
        Airport transfer</div>
      <div class="item">
        <input type="checkbox" name="service" value="Smoking area" class="fl mgl10 mgt1 servicesser5" onclick="searchbyhotel('ser5');">
        Smoking area</div>
      <div class="item">
        <input type="checkbox" name="service" value="Spa" class="fl mgl10 mgt1 servicesser6" onclick="searchbyhotel('ser6');">
        Spa</div>
      <div class="item">
        <input type="checkbox" name="service" value="Bar" class="fl mgl10 mgt1 servicesser7" onclick="searchbyhotel('ser7');">
        Bar</div>
      <div class="item">
        <input type="checkbox" name="service" value="Business facilities" class="fl mgl10 mgt1 servicesser8" onclick="searchbyhotel('ser8');">
        Business facilities</div>
      <a href="#" class="fl pdl10 blue undeline mgb10 mgt7">Need help for the booking call us</a> </div>
  </div>
  <img width="100%" class="fl mgt5" src="<?php echo base_url(); ?>public/images/rightbanner_03.png"> <img width="100%" class="fl mgt5" src="<?php echo base_url(); ?>public/images/rightbanner_03.png"> </div>
<?php
		$hotelname="";
		for($i=0;$i<count($name);$i++){
			if($i!=(count($name)-1)) $hotelname.= '"'.$name[$i]['name'].'",';
			else $hotelname.= '"'.$name[$i]['name'].'"';
			
		}?>
<script>
	$(function() {
		var hotelname = [
		<?php echo $hotelname; ?>
		];
		$( "#hotel_name" ).autocomplete({
		source: hotelname
		});
	});
	var listroomhotel=Array();
	for(var i=1;i<=1000;i++){		
		listroomhotel[i]=false;		
	}
	listroomhotel[1]=true;
	
	var postdata3={provide:'<?php echo $_GET['provide'] ?>',from:'<?php echo $_GET['from'] ?>',to:'<?php echo $_GET['to'] ?>',room:'<?php echo $_GET['room'] ?>',star:'<?php if(isset($_GET['star'])) echo $_GET['star'];else echo "all"; ?>'<?php if(isset($_GET['priority'])){?>,priority:'<?php echo $_GET['priority'] ?>'<?php }?><?php if(isset($_GET['price'])){?>,price:'<?php echo $_GET['price'] ?>'<?php }?><?php if(isset($_GET['price'])){?>,service:'<?php echo $_GET['service'] ?>'<?php }?><?php if(isset($_GET['price'])){?>,pagenumber:'<?php echo $_GET['pagenumber'] ?>'<?php }?>};	
	
	$(document).ready(function(){
		$('#hotel_name').val('');
		for(var i=0;i<1000;i++){
			if($('#star'+i).is(':checked')==true){
				$('#star'+i).attr('checked', false);
			};
			if($('#price'+i).is(':checked')==true){
				$('#price'+i).attr('checked', false);
			};
			if($('.servicesser'+i).is(':checked')==true){
				$('.servicesser'+i).attr('checked', false);
			};
		}
	});
	

	var ser=Array();
	var star=Array();
	var price=Array();
	<?php if(isset($_GET['service'])){?>
		ser.push('<?php echo $_GET['service'];?>');
	<?php }if(isset($_GET['star'])){?>
		star.push('<?php echo $_GET['star'];?>');
	<?php }if(isset($_GET['price'])){?>
		price.push('<?php echo $_GET['price'];?>');
	<?php }?>
	

		$('#btnsearch_hotel_name').click(function(){
			if($('#hotel_name').val()==""){				
				$('#hotel_name').addClass('bxshadow_ff0000');
				return false;
			}else{
				for(var r=1;r<=8;r++){
					if($('.services'+r).is(':checked')==true){
						ser.push($('.services'+r).val());			
					}else{	
						var check=-1;
						for(var i=0;i<ser.length;i++){
							if(ser[i]==$('.services'+r).val()){
								check=i;						
							}	
						}
						ser.splice(check,1);
					}

					if($('#star'+r).is(':checked')==true){
						star.push($('#star'+r).val());			
					}else{	
						var check=-1;
						for(var i=0;i<star.length;i++){
							if(star[i]==$('#star'+r).val()){
								check=i;						
							}	
						}
						star.splice(check,1);
					}
					
					if($('#price'+r).is(':checked')==true){
						price.push($('#price'+r).val());			
					}else{	
						var check=-1;
						for(var i=0;i<price.length;i++){
							if(price[i]==$('#price'+r).val()){
								check=i;						
							}	
						}
						price.splice(check,1);
					}								
				}
				postdata3.service=ser;	
				postdata3.star=star;
				postdata3.price=price;
				postdata3.priority=$('#priority').val();
				$.get('<?php echo base_url(); ?>home/ajax/getajax_hotel_search_result?hotelname='+$('#hotel_name').val(),postdata3,function(data){						
					$('#boxoutsize').html(data);
				});	 	
			}
		});
		$('#hotel_name').click(function(){
			$(this).removeClass('bxshadow_ff0000');							
		})
   	
	
	function searchbyhotel(number){
		for(var r=1;r<=8;r++){
			if(number=="ser"+r){
				if($('.services'+number).is(':checked')==true){
					ser.push($('.services'+number).val());			
				}else{	
					var check=-1;
					for(var i=0;i<ser.length;i++){
						if(ser[i]==$('.services'+number).val()){
							check=i;						
						}	
					}
					ser.splice(check,1);
				}
			}
			if(number=="star"+r){
				if($('#'+number).is(':checked')==true){
					star.push($('#'+number).val());			
				}else{	
					var check=-1;
					for(var i=0;i<star.length;i++){
						if(star[i]==$('#'+number).val()){
							check=i;						
						}	
					}
					star.splice(check,1);
				}
			}
			if(number=="price"+r){
				if($('#'+number).is(':checked')==true){
					price.push($('#'+number).val());			
				}else{	
					var check=-1;
					for(var i=0;i<price.length;i++){
						if(price[i]==$('#'+number).val()){
							check=i;						
						}	
					}
					price.splice(check,1);
				}
			}			
		}
		postdata3.service=ser;	
		postdata3.star=star;
		postdata3.price=price;
		postdata3.priority=$('#priority').val();
		$.get('<?php echo base_url(); ?>home/ajax/getajax_hotel_search_result',postdata3,function(data){						
			$('#boxoutsize').html(data);
		});	 
	}
</script>
